home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2002 May / CD Rom Data Mayıs 2002.iso / Freeware / Blitz Basic / data1.cab / Support / help / samples / isometric.bb < prev    next >
Encoding:
Text File  |  2002-04-10  |  824 b   |  50 lines

  1. ;isometric landscape demo
  2. ;copyright ⌐2000 EdzUp
  3. ;written by Ed Upton
  4.  
  5. Graphics 640,480
  6. SetBuffer BackBuffer()
  7.  
  8. ;adjust this value to adjust land height
  9. Global LandHeight=15
  10.  
  11. Dim land(21,21)
  12.  
  13. SetupLand()
  14.  
  15. While Not KeyDown(1)
  16.  Cls
  17.  SetupLand()
  18.  UpdateLand()
  19.  Flip
  20. Wend
  21. End
  22.  
  23. Function SetupLand()
  24.  For yy=0 To 21
  25.   For xx=0 To 21
  26.    land(xx,yy)=Rnd(LandHeight)
  27.    land(xx,yy)=land(xx,yy)-Rnd(LandHeight)
  28.   Next
  29.  Next
  30. End Function
  31.  
  32. Function UpdateLand()
  33.  ;cursor position
  34.  cx=320
  35.  cy=150
  36.  Color 255,255,255
  37.  For yy=0 To 20
  38.   ;actual x and y
  39.   ax=cx
  40.   ay=cy
  41.   For xx=0 To 20 
  42.    If xx<20 Then Line ax,ay-land(xx,yy),ax+16,(ay+8)-land(xx+1,yy)
  43.    If yy<20 Then Line ax,ay-land(xx,yy),ax-16,(ay+8)-land(xx,yy+1)
  44.    ax=ax+16
  45.    ay=ay+8
  46.   Next
  47.   cx=cx-16
  48.   cy=cy+8
  49.  Next
  50. End Function